/*                                                                                                                           
 * JFFS3 -- Journalling Flash File System, Version 3.                                                                        
 *                                                                                                                           
 * Copyright (C) 2006  Ferenc Havasi <havasi@inf.u-szeged.hu>,                                                               
 *                     Zoltan Sogor <weth@inf.u-szeged.hu>,                                                                  
 *                     Matyas Majzik <admin@newarcana.com>,                                                               
 *                     University of Szeged, Hungary                                                                         
 *
 * This software is distributed under the GNU GPL v2.
 * For licensing information, see the file 'LICENCE' in this directory.                                                             
 *                                                                                                                           
 */

#ifndef __SYS_EMU_H__
#define __SYS_EMU_H__

#include "kernel.h"

struct inode *smkdir(struct inode *where, char *name);
int srmdir(struct inode *which);
struct inode *stouch(struct inode *where, char *name);
int sdelete(struct inode *which);

int sread(struct inode *which, uint32_t page_nr, uint32_t *buf,
          uint32_t *retlen);
int swrite(struct inode *which, uint64_t ofs, uint32_t len, const uint32_t *buf,
           uint32_t *retlen);

int load_fs();
int smount(uint32_t flags);
int sumount();
int register_filesystem(struct file_system_type *type);
struct super_block *sget(struct file_system_type *type, int (*set)(struct super_block *,void *), void *data);
void deactivate_super(struct super_block *sb);

struct inode *new_inode(struct super_block *sb);
void destroy_inode(struct inode *inode);

struct dentry *d_alloc(struct dentry *parent, const char *name);
void d_free(struct dentry *d);
void d_instantiate(struct dentry *entry, struct inode *inode);

struct inode *iget(struct super_block *sb, unsigned long ino);
struct dentry *d_alloc_root(struct inode * root_inode);

#endif /*__SYS_EMU_H__ */
